#include "form.h"
#include "ui_form.h"
#include<QPainter>
#include<QPaintEvent>
#include"inter.h"
Form::Form(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Form)
{
    ui->setupUi(this);
    //窗口标题
    setMinimumSize(600,450);
    setMaximumSize(600,450);
    setWindowTitle("游戏规则");
    //返回主窗口按钮
    button = new QPushButton(this);
    button->setGeometry(250,250,100,40);
    button->setText("back");
    button->setStyleSheet("QPushButton{border-image:url(:/background/image/f2e692c7f646fc46b14102a50dc2682.jpg)}");
    connect(button,SIGNAL(clicked()),this,SLOT(comeback()));
}

Form::~Form()
{
    delete ui;
}
//背景
void Form::paintEvent(QPaintEvent*){

    QPainter painter(this);
    painter.drawRect(0,0,600,450);
    QPixmap pixmap(":/background/image/back2.jpg");

    painter.drawPixmap(0,0,600,450,pixmap);

}
//槽函数
void Form::comeback(){
    this->close();
    inter *i=new inter();
    i=new inter();
    i->show();




}

